package com.ruoyi.ktv.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ktv.mapper.KtvSubOrderMapper;
import com.ruoyi.ktv.domain.KtvSubOrder;
import com.ruoyi.ktv.service.IKtvSubOrderService;

/**
 * 子订单管理Service业务层处理
 * 
 * @author xubiao
 * @date 2023-03-01
 */
@Service
public class KtvSubOrderServiceImpl implements IKtvSubOrderService 
{
    @Autowired
    private KtvSubOrderMapper ktvSubOrderMapper;

    /**
     * 查询子订单管理
     * 
     * @param subOrderId 子订单管理主键
     * @return 子订单管理
     */
    @Override
    public KtvSubOrder selectKtvSubOrderBySubOrderId(Long subOrderId)
    {
        return ktvSubOrderMapper.selectKtvSubOrderBySubOrderId(subOrderId);
    }

    /**
     * 查询子订单管理列表
     * 
     * @param ktvSubOrder 子订单管理
     * @return 子订单管理
     */
    @Override
    public List<KtvSubOrder> selectKtvSubOrderList(KtvSubOrder ktvSubOrder)
    {
        return ktvSubOrderMapper.selectKtvSubOrderList(ktvSubOrder);
    }

    /**
     * 新增子订单管理
     * 
     * @param ktvSubOrder 子订单管理
     * @return 结果
     */
    @Override
    public int insertKtvSubOrder(KtvSubOrder ktvSubOrder)
    {
        ktvSubOrder.setCreateTime(DateUtils.getNowDate());
        return ktvSubOrderMapper.insertKtvSubOrder(ktvSubOrder);
    }

    /**
     * 修改子订单管理
     * 
     * @param ktvSubOrder 子订单管理
     * @return 结果
     */
    @Override
    public int updateKtvSubOrder(KtvSubOrder ktvSubOrder)
    {
        ktvSubOrder.setUpdateTime(DateUtils.getNowDate());
        return ktvSubOrderMapper.updateKtvSubOrder(ktvSubOrder);
    }

    /**
     * 批量删除子订单管理
     * 
     * @param subOrderIds 需要删除的子订单管理主键
     * @return 结果
     */
    @Override
    public int deleteKtvSubOrderBySubOrderIds(Long[] subOrderIds)
    {
        return ktvSubOrderMapper.deleteKtvSubOrderBySubOrderIds(subOrderIds);
    }

    /**
     * 删除子订单管理信息
     * 
     * @param subOrderId 子订单管理主键
     * @return 结果
     */
    @Override
    public int deleteKtvSubOrderBySubOrderId(Long subOrderId)
    {
        return ktvSubOrderMapper.deleteKtvSubOrderBySubOrderId(subOrderId);
    }
}
